# -*- mode: python ; coding: utf-8 -*-

# 获取 PyQt5 的插件路径（手动指定）
pyqt5_plugin_dir = None
try:
    from PyQt5 import QtCore
    pyqt5_plugin_dir = os.path.join(os.path.dirname(QtCore.__file__), "Qt5", "plugins")
except ImportError:
    raise RuntimeError("PyQt5 未安装！")


a = Analysis(
    [
        './g1.py',
        './encrypt_all_files.py',
        './api.py',

        './log/safe_log.py',
        './log/log_util.py',

    ],
    pathex=[],
    binaries=[],
    datas= [
        ('g1_description', 'g1_description'),
        ('/home/mega/anaconda3/envs/robot/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms', 'PyQt5/Qt5/plugins/platforms'),
        (os.path.join(pyqt5_plugin_dir, "platforms"), "PyQt5/Qt5/plugins/platforms"),
        (os.path.join(pyqt5_plugin_dir, "xcbglintegrations"), "PyQt5/Qt5/plugins/xcbglintegrations")
        
    ],
    hiddenimports=['PyQt5.QtXcbQpa', 'netifaces'],  # 确保包含 xcb 插件
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='g1',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
coll = COLLECT(
    exe,
    a.binaries,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='g1',
)
